//Class that represents a drawedObject 
//(Abstract)

DrawedObject = function(){
	this.index;
	this.ctx;
}

DrawedObject.prototype.getImageArray = function(){
	return this.getAllImgArray()[this.getImgArrayIndex()];
	//getAllImgArray defined in Map...
}

DrawedObject.prototype.getImage = function(){
	//hack index not supported yet this.getIndex()[1] intead of this.getIndex()
	return this.getImageArray()[this.index[1]];
}

//constructor
DrawedObject.prototype.superInitialize = function(aCtx, anIndex){
	this.index = anIndex;
	this.ctx = aCtx;
}

//methods
/* To override
DrawedObject.prototype.draw = function(x,y){};
*/

DrawedObject.prototype.drawThroughIsometricTransformation = function(xPosition, yPosition, img){
	/*function that display a Tile*/
	
	//WARNING : isometric transformation doesn't work on upper ground tiles, it's not real 3D
	
	//isometric transformation and draw the image
	this.ctx.save();
	this.ctx.translate(xPosition+45,yPosition-7);
	this.ctx.scale(1,0.5);
	this.ctx.rotate(Math.PI/4);
	this.ctx.scale(1.4,1.23);
	this.displayNoCood(img);
	this.ctx.restore();
}

DrawedObject.prototype.displayNoCood = function(img){
	this.ctx.drawImage(img,0,0);
}

DrawedObject.prototype.display = function(x,y,img){
	this.ctx.drawImage(img,x,y);
}
